#ifndef SIMPLE_IO_HANDLE_H
#define SIMPLE_IO_HANDLE_H

#include "handle_common.h" // operation custom_unique_ptr

namespace simple::io
{
	enum class handle : int {};

	struct close_handle_config
	{
		using handle_t = handle;
		static handle null() noexcept;
		static void deleter(handle) noexcept;
	};

	using unique_handle = custom_unique_ptr<close_handle_config>;

	// TODO: implicit conversion to an inerface with a subset of allowed operations
	template <operation allowed>
	struct interface
	{
		constexpr static auto allowed_operations = allowed;
		unique_handle handle;
	};

} // namespace simple::io

#endif /* end of include guard */
